condition for equivalence relation